package com.ruoyi.fly.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fly.domain.vo.ChlLbtVo;
import com.ruoyi.fly.service.ChlLbtService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/chlLbt")
@Api(tags = "轮播图管理")
public class ChlLbtController extends BaseController {

    @Autowired
    private ChlLbtService chlLbtService;

    /**
     * 查询轮播图列表
     */
    @ApiOperation(value = "查询轮播图列表", notes = "查询轮播图列表")
    @PostMapping(value = "/selectList")
    public TableDataInfo list() {
        startPage();
        return getDataTable(chlLbtService.selectLbtList());
    }

    @ApiOperation(value = "后台添加轮播图", notes = "后台添加轮播图")
    @PostMapping(value = "/addlbt")
    public R addlbt(@RequestBody ChlLbtVo chlLbt) {
        return chlLbtService.addlbt(chlLbt);
    }

    @ApiOperation(value = "后台删除轮播图", notes = "后台删除轮播图")
    @PostMapping(value = "/deletelbt")
    public R deletelbt(@RequestBody List<String> ids) {
        return chlLbtService.deleteLbtByIds(ids);
    }
}
